package com.kk.base.dao.home;


import com.kk.base.entity.home.Complaint;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Repository;

/**
 * @info :  投诉数据库实体类
 */
@Repository
public interface ComplaintDao extends JpaRepository<Complaint,Long>{


    /**
     * 通过id查找
     * @param id
     * @return
     */
    @Query("select c from Complaint c where id = :id")
    Complaint find(@Param("id")Long id);


    /**
     * 根据投诉编号和投诉用户查询
     * @param homeUserId
     * @param WaybillNumber
     * @return
     */
    Complaint findByHomeUser_IdAndWaybillNumber(Long homeUserId,String WaybillNumber);



}
